<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<data jsxid="jsxroot">
			<xsl:for-each select="data/record">
					<xsl:variable name="curDefId" select="@defEntityId"/>
					<record>
							<xsl:attribute name="jsxid">
								<xsl:value-of select="@jsxid"/>
							</xsl:attribute>
							<xsl:attribute name="defName">
								<xsl:value-of select="@defName"/>
							</xsl:attribute>
							<xsl:attribute name="defEntityId">
								<xsl:value-of select="@defEntityId"/>
							</xsl:attribute>
	
							<xsl:attribute name="defSuccess">
								<xsl:for-each select="./record[@success='true']">
									<xsl:value-of select="@nodeName"/>
									<xsl:if test="position() !=last()">
										<xsl:text>,</xsl:text>
									</xsl:if>
								</xsl:for-each>
							</xsl:attribute>

							<xsl:attribute name="defFailure">
								<xsl:for-each select="./record[@success='false']">
									<xsl:value-of select="@nodeName"/>
									<xsl:if test="position() !=last()">
										<xsl:text>,</xsl:text>
									</xsl:if>
								</xsl:for-each>
							</xsl:attribute>
					</record>

			</xsl:for-each>
		</data>
	</xsl:template>
	
</xsl:stylesheet>
